import {Injectable} from '@angular/core';
import {NzMessageService} from 'ng-zorro-antd/message';

@Injectable()
export class MessageService {

  constructor(private ngMsgService: NzMessageService) {
  }

  showMessage(messageKey: string, messageType: MessageType, defaultMessageIfNotFound?: string, params?: { [name: string]: string }): void {
    this.ngMsgService.create(messageType, messageKey, {nzDuration: 5000});
  }

  showLocalizedMessage(messageKey: string, defaultMessageIfNotFound: string = '', hiddenCallBack?: () => void): void {

  }

  showLocalizedErrorMessage(messageKey: string, defaultMessageIfNotFound: string = '', hiddenCallBack?: () => void): void {

  }

  showLocalizedWarningMessage(messageKey: string, defaultMessageIfNotFound: string = ''): void {

  }

  confirm(message: string, confirmButtonText?: string, cancelButtonText?: string, confirmCallBack?: (result: boolean) => void,
          params?: { [name: string]: string }, title?: string): void {

  }

  alert(message: string, confirmButtonText?: string, confirmCallBack?: (result: boolean) => void, params?: { [name: string]: string }, title?: string): void {
  }
}

export enum MessageType {
  success = 'success',
  info = 'info',
  warning = 'warning',
  error = 'error',
  loading = 'loading'
}
